<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      @keyframes ColorChange {
        0% {
          outline: 1px solid lightgreen;
        }

        50% {
          outline: 1px solid green;
        }

        1000% {
          outline: 1px solid lightgreen;
        }
      }

      svg {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate3d(-50%, -50%, 0);
        outline: 1px solid red;
        animation: ColorChange 500ms ease infinite;
      }

      line,
      polyline,
      rect {
        stroke-linecap: round;
        stroke-linejoin: round;
      }
    </style>
  </head>

  <body>
    <svg width="600"
         height="600"
         xmlns="http://www.w3.org/2000/svg"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         preserveAspectRatio="xMinYMin meet"
         stroke-linecap="round"
         stroke-linejoin="round"
         viewBox="0 0 600 600">

      <defs>
        <pattern id="tile"
                 x="0"
                 y="0"
                 width="20%"
                 height="20%"
                 patternUnits="objectBoundingBox">
          <path d="M 0 0 Q 5 20 10 10 T 20 20"
                style="stroke: black; fill: none;" />
          <path d="M 0 0 h 20 v 20 h -20 z"
                style="stroke: gray; fill: none;" />
        </pattern>
        <pattern id="skewed-tile"
                 patternTransform="skewY(15)"
                 xlink:href="#tile" />
        <linearGradient id="plain">
          <stop offset="0%"
                style="stop-color: #ffcc00;" />
          <stop offset="33.3%"
                style="stop-color: #cc6699;" />
          <stop offset="100%"
                style="stop-color: #66cc99;" />
        </linearGradient>
        <linearGradient id="skewed-gradient"
                        gradientTransform="skewX(10)"
                        xlink:href="#plain" />
      </defs>
      <rect x="20"
            y="10"
            width="100"
            height="100"
            style="fill: url(#tile); stroke: black;" />
      <rect x="135"
            y="10"
            width="100"
            height="100"
            style="fill: url(#skewed-tile); stroke: black;" />
      <rect x="20"
            y="120"
            width="200"
            height="50"
            style="fill: url(#plain); stroke: black;" />
      <rect x="20"
            y="190"
            width="200"
            height="50"
            style="fill: url(#skewed-gradient); stroke: black;" />






    </svg>

    <script>
      const ele = document.querySelector("#xxx");
      let n = 0;
      function Renderer() {
        n++;
        if (n >= 360) n = 0;
        window.requestAnimationFrame(Renderer);
      }
      // Renderer();
    </script>
  </body>

</html>
